import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralProjectInfo = (params) => {
  params.head.transCode = 'queryGeneralProjectInfo';
  return request({
    url: '/general/generalProjectInfo/queryGeneralProjectInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralProjectInfoListPage = (params) => {
  params.head.transCode = 'queryGeneralProjectInfoListPage';
  return request({
    url: '/general/generalProjectInfo/queryGeneralProjectInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralProjectInfo = (params) => {
  params.head.transCode = 'saveGeneralProjectInfo';
  return request({
    url: '/general/generalProjectInfo/saveGeneralProjectInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralProjectInfoList = (params) => {
  params.head.transCode = 'saveGeneralProjectInfoList';
  return request({
    url: '/general/generalProjectInfo/saveGeneralProjectInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralProjectInfo = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralProjectInfo';
  return request({
    url: '/general/generalProjectInfo/saveOrUpdateGeneralProjectInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralProjectInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralProjectInfoList';
  return request({
    url: '/general/generalProjectInfo/saveOrUpdateGeneralProjectInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralProjectInfo = (params) => {
  params.head.transCode = 'updateGeneralProjectInfo';
  return request({
    url: '/general/generalProjectInfo/updateGeneralProjectInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralProjectInfo = (params) => {
  params.head.transCode = 'deleteGeneralProjectInfo';
  return request({
    url: '/general/generalProjectInfo/deleteGeneralProjectInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralProjectInfoList = (params) => {
  params.head.transCode = 'deleteGeneralProjectInfoList';
  return request({
    url: '/general/generalProjectInfo/deleteGeneralProjectInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralProjectInfoExcel = (params) => {
  downloadExcel({
    url: '/general/generalProjectInfo/excelDownload/exportGeneralProjectInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
